<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>添加/修改页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../component/elementUI/index.css">
    <link rel="stylesheet" href="../../../component/pear/css/pear.css" />
    <link rel="stylesheet" href="../../../style/wangeditor.css">
    <link rel="stylesheet" href="../../../style/index.css">
</head>

<body>
    <div id="app" v-cloak>
        <div class="add">
            <div class="header">
                <span>{{(action == 'Add'?'添加':'修改')}}商品品牌</span>
            </div>
            <div class="main" style="padding: 0 15px;">
                <!-- 配置属性, 目前仅支持 单主表 多子表 结构 -->
                <div id="form"
                    :data-options="JSON.stringify({'tableName':'article_brand','formName':'dataForm' ,'primaryKey':'Brand_SerialNumber'})">
                    <div
                        :data-options="JSON.stringify({'tableName':'article_brand_mapping_column','formName':'childDataForm' ,'primaryKey':'article_brand'})">
                    </div>
                </div>
                <div class="table_titel">
                    <div class="titel">商品品牌</div>
                </div>
                <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
                    <el-descriptions :column="2" size="large" border>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">品牌名称</div>
                            </template>
                            <el-form-item prop="Brand_Name"
                                :rules="[{ required: true, message: '请输入品牌名称', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Brand_Name" placeholder="请输入品牌名称" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">品牌Logo</div>
                            </template>
                            <el-form-item prop="Brand_Logo">
                                <yl-upload v-model="dataForm.Brand_Logo"></yl-upload>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">综合品牌力</div>
                            </template>
                            <el-form-item prop="Comprehensive_Brand_Strength"
                                :rules="[{ required: true, message: '请输入综合品牌力', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Comprehensive_Brand_Strength" placeholder="请输入综合品牌力" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">主营类目品牌力</div>
                            </template>
                            <el-form-item prop="Brand_Power_Main"
                                :rules="[{ required: true, message: '请输入主营类目品牌力', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Brand_Power_Main" placeholder="请输入主营类目品牌力" />
                            </el-form-item>
                        </el-descriptions-item>

                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">商标注册号</div>
                            </template>
                            <el-form-item prop="Trademark_Registration_Number"
                                :rules="[{ required: true, message: '请输入商标注册号', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Trademark_Registration_Number"
                                    placeholder="请输入商标注册号" />
                            </el-form-item>
                        </el-descriptions-item>



                    </el-descriptions>
                </el-form>
                <div class="table_titel">
                    <div class="titel">商品品牌关联类目</div>
                    <div class="operation">
                        <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
                        <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
                    </div>
                </div>
                <el-form :model="{childDataForm:childDataForm.filter(i=>i.Row_Status != '1')}" ref="childForm"
                    :inline-message="true" style="width: 100%">
                    <el-descriptions :column="2" size="large" border
                        v-for="(item,index) in childDataForm.filter(i=>i.Row_Status != '1')" :key="index">
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">类目</div>
                            </template>
                            <el-form-item :prop="`childDataForm.${index}.Column_SerialNumber`"
                                :rules="[{ required: true, message: '请输入类目流水号', trigger: 'blur' }]">
                                <el-select v-model.trim="item.Column_SerialNumber" placeholder="请选择类目"
                                    style="width: 100%;" clearable filterable>
                                    <el-option v-for="(item,index) in article_column" :key="index"
                                        :label="item.Column_Name" :value="item.Column_SerialNumber" />
                                </el-select>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">资质</div>
                            </template>
                            <el-form-item prop="Picture_URL">
                                <yl-upload v-model="item.Picture_URL"></yl-upload>
                            </el-form-item>
                        </el-descriptions-item>
                    </el-descriptions>
                </el-form>
            </div>
            <div class="footer">
                <el-button size="medium" @click="handleBack">返回</el-button>
                <el-button size="medium" type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="../../../utils/wangeditor.js"></script>
    <script type="text/javascript" src="../../../utils/xlsx.full.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../utils/vue.min.js"></script>
    <script type="text/javascript" src="../../../utils/vuex.min.js"></script>
    <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
    <script type="text/javascript" src="../../../utils/components.js"></script>
    <script type="text/javascript" src="../../../utils/compressor.js"></script>
    <script type="text/javascript" src="../../../utils/validity.js"></script>
    <script type="text/javascript" src="../../../utils/utils.js"></script>
    <script type="text/javascript" src="../../../utils/http.js"></script>
    <script type="text/javascript" src="js/add.js"></script>
</body>

</html>